package com.tuo51.evaluate.domain.appusers;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.tuo51.core.domain.staffs.Staff;
import com.tuo51.foudation.model.Domain;
import lombok.Data;

import javax.persistence.*;

@Data
@Entity
@Table(name = "staff_redeem_code")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer"})
public class StaffRedeemCode extends Domain {

	@JsonIgnore
	@Column(name = "staff_id")
	private String staffId;

	@JsonIgnore
	@OneToOne
	@JoinColumn(name = "staff_id", insertable = false, updatable = false)
	Staff staff;

    @Column(name = "redeem_code_id")
    private String redeemCodeId;

	@JsonIgnore
	@OneToOne
	@JoinColumn(name = "redeem_code_id", insertable = false, updatable = false)
	RedeemCode redeemCode;

	@JsonIgnore
	@Column(name = "product_id")
	private Long productId;  // always leads to vip id

	@Column(name = "comment", columnDefinition = "varchar(128) COMMENT '兑换结果' ")
	private String comment;

}
